package com.waiting.bigDecimal;

import java.math.BigDecimal;

/**
 * @author bjweitingting
 * @desctiption
 * @date 2018/7/2
 **/
public class IntegerMain {
    public static void main(String[] args) {
        //拆箱操作
        Integer test = 1;
        int testint = test;
        System.out.println(testint);

        BigDecimal bigDecimal = new BigDecimal(3);
        System.out.println(bigDecimal.multiply(new BigDecimal(2)));

        int param1 = 100;
        int param2 = 50;
        System.out.println(param1 % param2 == 0 ? param1 / param2 : param1 / param2 + 1);
        testIntegerCache();
    }

    public static void testIntegerCache() {
        System.out.println("testIntegerCache start");
        Integer test1 = new Integer(1);
        Integer test2 = Integer.valueOf(1);
        Integer test3=1;
        System.out.println("test1==test2:" + (test1 == test2));  //false
        System.out.println("test2==test3:" + (test2 == test3));   //true test3:自动装箱
        System.out.println("testIntegerCache end");
    }
}
